#!/usr/bin/env bash

cur_dir=`pwd`
echo "-- info, welcome to use p2pcpp!"

version=p2pcpp_v1.2.6.mac

temp_dir=`mktemp -d`
log_file=$temp_dir/operation.log
cd $temp_dir

echo "run time:`date`" >> $log_file


file_url=http://40.73.35.128:7656/download/p2pcpp/binary/$version.tar.gz
curl -o $version.tar.gz  $file_url

if [ -f $version.tar.gz ] ; then
    tar -zxf $version.tar.gz  && cd $version/bin && ./tester_client.sh
else
    echo "-- error, download file failed, url is:$file_url"
fi

echo "-- info, work directory is:$temp_dir"
echo "-- info, version:$version"










